package com.wangdao.wechatmall.controller.wx;

import com.wangdao.wechatmall.bean.vo.admin.BaseRespVo;
import com.wangdao.wechatmall.bean.vo.wx.CatalogIndexVO;
import com.wangdao.wechatmall.bean.vo.wx.CurrentCatalogVO;
import com.wangdao.wechatmall.service.wx.WXCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Author: JK
 * @Date: create in 2021/7/11 23:31
 */
@RestController
@RequestMapping("wx/catalog")
public class WXCatalogController {
    @Autowired
    WXCatalogService wxCatalogService;

    @RequestMapping("index")
    public BaseRespVo index() {
        CatalogIndexVO catalogIndexVO = wxCatalogService.showCatalog();
        return BaseRespVo.ok(catalogIndexVO);
    }

    @RequestMapping("current")
    public BaseRespVo current(Integer id) {
        CurrentCatalogVO currentCatalogVO = wxCatalogService.showCurrentCatalog(id);
        return BaseRespVo.ok(currentCatalogVO);
    }
}
